fix(browser): exclude DNS errors from consecutive failure limit#1156
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Excludes Firefox dnsNotFound (NXDOMAIN) neterrors from contributing to the consecutive failure limit that stops crawling, and adds tests to ensure crawls continue through large numbers of nonexistent domains.
Changes:
- Added
_is_dns_error()predicate and used it to skip incrementingfailure_countondnsNotFound. - Added an integration test that navigates to 110
.invaliddomains to verify no failure-limit abort occurs. - Added a unit test that imports and validates the real
_is_dns_error()predicate.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
openwpm/browser_manager.py |
Adds _is_dns_error() and uses it to exclude dnsNotFound from the failure counter. |
test/test_webdriver_utils.py |
Adds integration + unit tests validating the new DNS-exclusion behavior and predicate correctness. |
.gitignore |
Adds ignore rules for Crosslink/Claude-generated local state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1156 +/- ##
==========================================
+ Coverage 62.16% 62.19% +0.03%
==========================================
Files 40 40
Lines 3898 3902 +4
==========================================
+ Hits 2423 2427 +4
Misses 1475 1475 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e6d86c9 to
72ea044
Compare
cc064fd to
1ab9595
Compare
1ab9595 to
a67fac3
Compare
Extract the inline is_dns_error predicate from execute_command_sequence into a module-level _is_dns_error() function so the test imports and exercises the real code instead of a local copy. Remove unused CommandExecutionError import from the test file.
a67fac3 to
0698f44
Compare
- Move failure_count threshold check inside threadlock so increment and compare are atomic across browser threads. - Reduce test domain count from 110 to failure_limit*3 and wrap the navigation loop in try/finally for cleanup on failure. Browser restart on DNS errors is intentional — appropriately cautious for our use case.
0698f44 to
9228048
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dnsNotFound/ NXDOMAIN) no longer count toward the consecutive failure limit that stops crawling. The browser still restarts after each DNS error — appropriately cautious for the measurement use case.is_dns_error()as a named, importable function for testabilitytask_manager.threadlockacross both thefailure_countincrement and the threshold compare so the update+compare is atomic across browser threadsfailure_limit * 3nonexistent domains, verifying the crawl continues pastfailure_limit=5Only
dnsNotFoundis excluded — DNS timeouts/SERVFAIL intentionally still count as they may indicate real network issues.Supersedes #1139.
Closes #1116
Test plan
test_dns_error_does_not_count_against_failure_limitpassestest_is_dns_error_predicatetests the realis_dns_errorfunctionpre-commit run --all-filespasses